package com.shopnight.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 外卖商品信息表
 * @TableName takeout_goods
 */
@TableName(value ="takeout_goods")
@Data
public class TakeoutGoods implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 商品价格
     */
    private BigDecimal price;

    /**
     * 秒杀标记 0->普通商品 1->秒杀商品
     */
    private Integer seckill;

    /**
     * 秒杀价格
     */
    private BigDecimal priceSeckil;

    /**
     * 商品图片 
     */
    private String images;

    /**
     * 商品库存
     */
    private Integer inStocks;

    /**
     * 销量
     */
    private Integer salesVolume;

    /**
     * 月销量
     */
    private Integer salesMonthVolume;

    /**
     * 描述
     */
    private String description;

    /**
     * 商户名称
     */
    private String merchantName;

    /**
     * 商户id
     */
    private Integer merchantId;

    /**
     * 数据入库时间
     */
    private Date insertTime;

    /**
     * 数据最后一次更新时间
     */
    private Date updateTime;

    /**
     * 删除时间
     */
    private Date deleteTime;

    /**
     * 是否已删除
     */
    private Integer beenDeleted;

    /**
     * 分类id
     */
    private Integer categoryId;

    /**
     * 分类名称
     */
    private String categoryName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TakeoutGoods other = (TakeoutGoods) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getSeckill() == null ? other.getSeckill() == null : this.getSeckill().equals(other.getSeckill()))
            && (this.getPriceSeckil() == null ? other.getPriceSeckil() == null : this.getPriceSeckil().equals(other.getPriceSeckil()))
            && (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
            && (this.getInStocks() == null ? other.getInStocks() == null : this.getInStocks().equals(other.getInStocks()))
            && (this.getSalesVolume() == null ? other.getSalesVolume() == null : this.getSalesVolume().equals(other.getSalesVolume()))
            && (this.getSalesMonthVolume() == null ? other.getSalesMonthVolume() == null : this.getSalesMonthVolume().equals(other.getSalesMonthVolume()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getMerchantName() == null ? other.getMerchantName() == null : this.getMerchantName().equals(other.getMerchantName()))
            && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId()))
            && (this.getInsertTime() == null ? other.getInsertTime() == null : this.getInsertTime().equals(other.getInsertTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getDeleteTime() == null ? other.getDeleteTime() == null : this.getDeleteTime().equals(other.getDeleteTime()))
            && (this.getBeenDeleted() == null ? other.getBeenDeleted() == null : this.getBeenDeleted().equals(other.getBeenDeleted()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getCategoryName() == null ? other.getCategoryName() == null : this.getCategoryName().equals(other.getCategoryName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getSeckill() == null) ? 0 : getSeckill().hashCode());
        result = prime * result + ((getPriceSeckil() == null) ? 0 : getPriceSeckil().hashCode());
        result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
        result = prime * result + ((getInStocks() == null) ? 0 : getInStocks().hashCode());
        result = prime * result + ((getSalesVolume() == null) ? 0 : getSalesVolume().hashCode());
        result = prime * result + ((getSalesMonthVolume() == null) ? 0 : getSalesMonthVolume().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getMerchantName() == null) ? 0 : getMerchantName().hashCode());
        result = prime * result + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode());
        result = prime * result + ((getInsertTime() == null) ? 0 : getInsertTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getDeleteTime() == null) ? 0 : getDeleteTime().hashCode());
        result = prime * result + ((getBeenDeleted() == null) ? 0 : getBeenDeleted().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getCategoryName() == null) ? 0 : getCategoryName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", price=").append(price);
        sb.append(", seckill=").append(seckill);
        sb.append(", priceSeckil=").append(priceSeckil);
        sb.append(", images=").append(images);
        sb.append(", inStocks=").append(inStocks);
        sb.append(", salesVolume=").append(salesVolume);
        sb.append(", salesMonthVolume=").append(salesMonthVolume);
        sb.append(", description=").append(description);
        sb.append(", merchantName=").append(merchantName);
        sb.append(", merchantId=").append(merchantId);
        sb.append(", insertTime=").append(insertTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", deleteTime=").append(deleteTime);
        sb.append(", beenDeleted=").append(beenDeleted);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", categoryName=").append(categoryName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}